const mongoose = require('mongoose')

mongoose.connect(
  'mongodb://127.0.0.1:27017/koa2-dome',

  { 
    useNewUrlParser: true,
    useUnifiedTopology: true,
    useCreateIndex: true,
    useFindAndModify: false
  },

  (err) => {
    if(err) console.log(err.message)
    else console.log('mongodb数据库链接成功')
  }
)

module.exports = mongoose
